<?php echo $this->Html->script(array('print')); ?>
<?php App::import('Model', 'Detallepaciente'); ?>
<?php $Parametro = new Detallepaciente(); ?>

<div id="content">
    <div class="grid_container">
        <div class="grid_12">
            <div class="widget_wrap">
                <div class="widget_top">
                    <span class="h_icon blocks_images"></span>
                    <h6>Recetas del paciente</h6>
                </div>
                <div class="widget_content">
				<div id="areaImprimir">
                    <div class="top">
                         <h3>CENTRO MEDICO QUIRURGICO FUNDACION PIETRO GAMBA</h3>
                         <th>Telf. 044136102 - Fax: 4231772</th>
                        <table class="display">
                            <thead>
                                <tr >
                                    <th>
                                        <strong>MEDICO:</strong>
                                    </th>
                                    <th>
                                        Dr(a). <?php echo $nombremedico ?>
                                    </th>
                                </tr>
                                <tr >
                                    <th>
                                        <strong>NOMBRE:</strong>
                                    </th>
                                    <th>
                                        Sr(a). <?php echo $detallepaciente[0]['Paciente']['nombres'] . ' ' . $detallepaciente[0]['Paciente']['ap_paterno'] . ' ' . $detallepaciente[0]['Paciente']['ap_materno'] ?>
                                    </th>
                                </tr>                                
                            </thead>
                        </table>
                    </div>
                    <!-- ///////////////////////////////////////////////////////// -->
                    <table style="border: 1px #000" class="wtbl_list">
                        <thead>
                        <tr>
                            <th rowspan="2">MEDICAMENTO</th>
                            <th rowspan="2">DOSIS</th>
                        </tr>
                        </thead>
                        <tbody>                         

                        </tbody>
                    </table>

                </div>
				</div>
            </div>
        </div>
        <!--fin contenedor tabla-->
    </div>    
    <button type="submit" class="btn_small btn_blue" id="btnImprimir">
        <span>IMPRIMIR</span>
    </button>
</div> <!--fin contenido-->

<script>
    $(document).ready(function() {
        $("#vertical").hide();

        $("#btnVertical").click(function() {
            $("#vertical").toggle('slow');
        });
        $("#btnImprimir").click(function() {
            console.log('<?php echo $this->webroot ?>');
            //printElem({leaveOpen: true, printMode: 'popup'});
            printElem({overrideElementCSS: ["<?php echo $this->webroot ?>/css/imprimetabla.css"]});
        });

    });
    function printElem(options) {
        $('#areaImprimir').printElement(options);
    }
</script>